const path = require("path");

const VueLoaderPlugin = require('vue-loader/lib/plugin');

module.exports = {
    entry :path.join(__dirname,"./src/main.js"), //需要打包的文件
    module:{
        rules:[
            {
                test:/\.css$/,
                use:['style-loader', 'css-loader']
            },
            {
                //npm install vue-loader vue-template vue-style-loader -D
                test:/\.vue$/,
                loader:'vue-loader',
            },
            {
                test:/\.(jpg|jpeg|gif|png|bmp)$/,
                use:'url-loader'
            },
            {
                test:/\.(otf|eot|svg|ttf|woff|woff2)$/,
                use:'url-loader'
            },
            {
                test:/\.js$/,
                use:'babel-loader'
            },
            {
                test:/\.less$/,
                use:['style-loader', 'css-loader','less-loader']
            }
        ]
    },
    output:{
        filename:"bundle.js", //打包成的文件
        path: path.resolve(__dirname,"dist") //所在的文件夹
    },
    plugins:[
         new VueLoaderPlugin(), //配置插件节点
    ],
    mode:'production',
    performance:{
        hints:'warning',
        maxAssetSize:3000000, //单位字节，默认250Kb（250000）
        maxEntrypointSize:3000000
    }
       
    // watch: true //自动打包
}